package cn.tedu.egmvc1.Controller;

import cn.tedu.egmvc1.pojo.EmpDto;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class EmpController {
    @RequestMapping("/emp/insert")
    @ResponseBody
    public String insert(EmpDto empDto){
        String name = empDto.getName();
        Double salary = empDto.getSalary();
        String job = empDto.getJob();
        return "添加成功"+name+job+salary;
    }
    @RequestMapping("/emp/select")
    @ResponseBody
    public String select(){
        return "恭喜,查询成功";
    }
    @RequestMapping("/emp/update")
    @ResponseBody
    public String update(EmpDto empDto){
        Integer id = empDto.getId();
        String name = empDto.getName();
        Double salary = empDto.getSalary();
        String job = empDto.getJob();
        return "修改成功";
    }
    @RequestMapping("/emp/delete")
    @ResponseBody
    public String delete(Integer id){

        return "删除成功"+id;
    }
}
